package com.fhj.bookshop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fhj.bookshop.entity.Comments;
import com.fhj.bookshop.mapper.CommentsMapper;
import com.fhj.bookshop.service.ICommentsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author fu
 * @since 2023-12-26
 */
@Service
public class CommentsServiceImpl extends ServiceImpl<CommentsMapper, Comments> implements ICommentsService {

    @Autowired
    CommentsMapper commentsMapper;

    @Override
    public List<Comments> getComments(Integer proId){
        LambdaQueryWrapper<Comments> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(Comments::getProId,proId);
        return commentsMapper.selectList(wrapper);
    }


}
